﻿using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using KwaiXiaoDian.IService;
using KwaiXiaoDian.Service;
using SSharing.Frameworks.NetCore.Document;

namespace KwaiXiaoDian.Service
{
    public static class KwaiXiaoDianServiceExtension
    {
        public static IServiceCollection AddServices(this IServiceCollection services, IConfiguration configuration)
        {
            //注入服务
            services.AddScoped<ICookieService, CookieService>();
            services.AddScoped<IUserService, UserService>();
            services.AddScoped<IGroupLeaderService, GroupLeaderService>();
            services.AddScoped<IProductService, ProductService>();
            services.AddScoped<IKwaiXiaoDianService, KwaiXiaoDianService>();
            services.AddScoped<INoticeService, NoticeService>();
            services.AddScoped<IProductExpressService, ProductExpressService>();
            services.AddScoped<IProductShopService, ProductShopService>();
            services.AddScoped<IProductRankService, ProductRankService>();
            services.AddScoped<IChannelService, ChannelService>();
            services.AddSingleton<IDocument, EPPlusDocument>();
            services.AddScoped<IProductPromoteService, ProductPromoteService>();

            return services;
        }
    }
}
